package online.shiming.file.controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import online.shiming.file.pojo.User;
import online.shiming.file.service.UserService;
import online.shiming.file.util.DataDo;

/**
 * @author ShiMing
 * @version 1.0
 * @name UserController
 * @description TODO
 * @date 2020/11/21
 */

@RequestMapping("/file/user/")
@RestController
@Api("登录")
public class UserController {
    @Resource
    public UserService userService;

    @PostMapping("login")
    @ApiOperation(value = "登录")
    public DataDo<?> login(User user) {
        return userService.login(user);
    }

    @PostMapping("register")
    @ApiOperation(value = "注册")
    public DataDo<?> register(User user){
        return userService.register(user);
    }
}
